#include "widget.h"
#include "ui_widget.h"
#include <QListWidgetItem>
#include <QListWidget>
#include "cuseritem.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    QListWidgetItem* pItem1 = new QListWidgetItem(QIcon(":/resources/kits.png"), "Kits");
    QListWidgetItem* pItem2 = new QListWidgetItem(QIcon(":/resources/env.png"), "环境");
    QListWidgetItem* pItem3 = new QListWidgetItem(QIcon(":/resources/editor.png"), "编辑器");
    QListWidgetItem* pItem4 = new QListWidgetItem(QIcon(":/resources/vim.png"), "FakeVim");
    QListWidgetItem* pItem5 = new QListWidgetItem(QIcon(":/resources/help.png"), "帮助");
    QListWidgetItem* pItem6 = new QListWidgetItem("User Item");

    ui->listWidget->addItem(pItem1);
    ui->listWidget->addItem(pItem2);
    ui->listWidget->addItem(pItem3);
    ui->listWidget->addItem(pItem4);
    ui->listWidget->addItem(pItem5);
    ui->listWidget->addItem(pItem6);

    CUserItem *pUserItem = new CUserItem(this);
    ui->listWidget->setItemWidget(pItem6, pUserItem);



}


Widget::~Widget()
{
    delete ui;
}
